package com.test.dao;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;

public class BaseDao {

	@Autowired
	private SqlSessionTemplate sqlSession;

	public SqlSessionTemplate getSqlSession() {
		return sqlSession;
	}

	public void setSqlSession(SqlSessionTemplate sqlSession) {
		this.sqlSession = sqlSession;
	}

	public int delete(String statement, Object parameter) {

		return sqlSession.delete(statement, parameter);
	}

	public int delete(String statement) {

		return sqlSession.delete(statement);
	}

	public int insert(String statement, Object parameter) {

		return sqlSession.insert(statement, parameter);
	}

	public int insert(String statement) {

		return sqlSession.insert(statement);
	}

	public <T> List<T> selectList(String statement, Object parameter) {

		return sqlSession.selectList(statement, parameter);
	}

	public <T> List<T> selectList(String statement) {

		return sqlSession.selectList(statement);
	}

	public Object selectOne(String statement, Object parameter) {

		return sqlSession.selectOne(statement, parameter);
	}

	public Object selectOne(String statement) {

		return sqlSession.selectOne(statement);
	}

	public int update(String statement, Object parameter) {

		return sqlSession.update(statement, parameter);
	}

	public int update(String statement) {

		return sqlSession.update(statement);
	}

}